package priv.jesse.mall.service;

import priv.jesse.mall.entity.Address;
import priv.jesse.mall.entity.Order;
import priv.jesse.mall.entity.OrderItem;
import priv.jesse.mall.entity.Shopcart;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 购物车
 */
public interface ShopCartService {

    String NAME_PREFIX = "shop_cart_";

    /**
     * 加购物车
     * @param
     */
    void addCart(int productId,HttpServletRequest request) throws Exception;

    /**
     * 加购物车
     * @param
     */
    void newaddCart(int productId, int prodCount,HttpServletRequest request) throws Exception;

    /**
     * 加载购物车
     * @param
     */
    List<OrderItem> loadlistCart(HttpServletRequest request) throws Exception;

    Order payment(HttpServletRequest request, Integer shortid) throws Exception;



    /**
     * 加载购物车数量
     * @param
     */
    int loadShopcount(HttpServletRequest request) throws Exception;



    /**
     * 移除
     * @param productId
     * @param request
     */
    void remove(int productId, HttpServletRequest request) throws Exception;

    /**
     * 查看购物车
     * @param request
     * @return
     */
    List<OrderItem> listCart(HttpServletRequest request) throws Exception;



    int shortdelete(HttpServletRequest request,int shopcartid);

    int updateshortcount(HttpServletRequest request,int prodId,int count);

    List<Address>  loadeadress(int userid);


    Integer updateadress(HttpServletRequest request,String addressss)throws Exception;
}
